#include "coreplugin.h"

#include "mainwindow.h"

#include <extensionsystem/pluginmanager.h>
#include <QtCore/QtPlugin>

using namespace Core;
using namespace Core::Internal;

CorePlugin::CorePlugin() :
    m_pMainWindow(new MainWindow)
{
}

CorePlugin::~CorePlugin()
{
    delete m_pMainWindow;
}
#include <QPushButton>
#include <QVBoxLayout>
bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
    Q_UNUSED(arguments);
    Q_UNUSED(errorMessage);

    QPushButton* btn = new QPushButton;
    btn->setText(tr("buttonTest"));

    QVBoxLayout* layout = new QVBoxLayout;
    layout->addWidget(btn);
    m_pMainWindow->setLayout(layout);
    m_pMainWindow->show();

    return true;
}

void CorePlugin::extensionsInitialized()
{
}

ExtensionSystem::IPlugin::ShutdownFlag CorePlugin::aboutToShutdown()
{
//    m_mainWindow->aboutToShutdown();
    return SynchronousShutdown;
}

Q_EXPORT_PLUGIN(CorePlugin)
